package cn.hyx.invoicing.customer.rest;

import javax.ws.rs.Consumes;
import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
import javax.ws.rs.Produces;
import javax.ws.rs.core.MediaType;

import org.agile4j.plugin.rest.Rest;
import org.agle4j.framework.annotation.Inject;
import org.agle4j.framework.annotation.Service;

import com.fasterxml.jackson.databind.deser.std.MapEntryDeserializer;

import cn.hyx.invoicing.customer.entity.Customer;
import cn.hyx.invoicing.customer.service.CustomerService;

/**
 * 客户 REST 服务接口
 * 
 * @author hanyx
 */
@Rest
@Service
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
public class CustomerRestService {

	@Inject
	private CustomerService customerService ;
	
	/**
	 * 根据 客户ID 获取客户对象
	 * 
	 * @param customerId 客户ID
	 * @return 客户对象
	 */
	@GET
	@Path("/customer/{id}")
	public Customer getCustomer(@PathParam("id") String customerId) {
		return customerService.getCustomer(customerId) ;
	}
}
